﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace B02_LoveAndUnLove
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btn_Love_Click(object sender, EventArgs e)
        {
            MessageBox.Show("I Love You, too!");
            this.Close();
        }

        //重新设置unlove按钮的坐标
        private void btn_UnLove_MouseEnter(object sender, EventArgs e)
        {
            int xArea = this.ClientSize.Width - this.btn_UnLove.Width;
            int yArea = this.ClientSize.Height - this.btn_UnLove.Height;

            //生成随机位置
            Random r = new Random();
            btn_UnLove.Location = new Point(r.Next(0, xArea + 1), r.Next(0, yArea + 1));
        }

        private void btn_UnLove_Click(object sender, EventArgs e)
        {
            MessageBox.Show("还是被你这个屌丝点到了");
            this.Close();
        }
    }
}
